﻿@page "/counter"
@attribute [TabItemOption(Text = "Counter")]
@inject ILogger<MainLayout> nlogILogger;
<PageTitle>Counter</PageTitle>

<h1>Counter</h1>

<p role="status">Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
<button class="btn btn-primary" @onclick="OnClick">除0</button>

@code {
    private int currentCount = 0;

    private void IncrementCount()
    {
        currentCount++;
    }

    private void OnClick()
    {
    
        // try
        // {
            var a = 0;
            _ = 1 / a;
        // }
        // catch(Exception ex)
        // {
        //     nlogILogger?.LogError("哈哈哈:" + ex.ToString());
        // } 
    }
}
